package com.yiidata.rpc.thrift;

import org.apache.thrift.protocol.TProtocol;

import java.io.IOException;

import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.transport.TSocket;

/**
 * <pre>
 *
 * Created by IntelliJ IDEA.
 * User: zhenqin
 * Date: 14/11/12
 * Time: 11:36
 * To change this template use File | Settings | File Templates.
 *
 * </pre>
 *
 * @author zhenqin
 */
public class ThriftHelloWorldClient {



    public static void main(String[] args) throws IOException, TException {
        TSocket transport = new TSocket("localhost", 8088);

        TProtocol protocol = new TBinaryProtocol(transport);
        transport.open();
        ThriftHelloWorldProtocol.Client client = new ThriftHelloWorldProtocol.Client(protocol) ;
        System.out.println(client.sayHello(new User("Thrift Java RPC")).getHi());

    }

}
